Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@babel/plugin-transform-literals
Advanced tools
Compile ES2015 unicode string and number literals to ES5
The @babel/plugin-transform-literals package is a plugin for Babel, a JavaScript compiler, that transforms modern JavaScript literal syntax into a form compatible with older JavaScript engines. This includes transforming template literals, binary literals, octal literals, and Unicode string literals into strings and numbers that can be understood by environments that do not support these features natively.
Template Literals Transformation
Converts template literals into string concatenation to ensure compatibility with older JavaScript engines.
`Hello, ${name}!` -> 'Hello, ' + name + '!'
Binary Literals Transformation
Transforms binary literals into their decimal number equivalents.
0b101001 -> 41
Octal Literals Transformation
Converts octal literals into their decimal number equivalents.
0o755 -> 493
Unicode String Literals Transformation
Transforms Unicode string literals into escaped sequences compatible with older JavaScript engines.
'\u{1F680}' -> '\uD83D\uDE80'
This package specifically focuses on transforming template literals into string concatenation. While @babel/plugin-transform-literals covers a broader range of literal transformations, @babel/plugin-transform-template-literals provides a more focused approach on template literals, offering optimizations for cases where tagged templates are not used.
Similar to the Unicode string literals transformation provided by @babel/plugin-transform-literals, this package transforms Unicode escapes in string literals and identifiers. It offers a more specialized focus on Unicode transformations, potentially providing more detailed handling of edge cases in Unicode escape sequences.
Compile ES2015 unicode string and number literals to ES5
See our website @babel/plugin-transform-literals for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-literals
or using yarn:
yarn add @babel/plugin-transform-literals --dev
v7.25.9 (2024-10-22)
babel-parser
, babel-template
, babel-types
syntacticPlaceholders
mode (@liuxingbaoyu)babel-helper-compilation-targets
, babel-preset-env
ClassAccessorProperty
to prevent the no-undef
rule (@victorenator)babel-parser
, babel-types
VISITOR_KEYS
etc. faster to access (@liuxingbaoyu)FAQs
Compile ES2015 unicode string and number literals to ES5
The npm package @babel/plugin-transform-literals receives a total of 20,424,097 weekly downloads. As such, @babel/plugin-transform-literals popularity was classified as popular.
We found that @babel/plugin-transform-literals demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.